-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(browser): Use apply
rather than call
in try-catch
integration
#4695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we're here, can we add a integration test for this?
size-limit report
|
cc @BYK |
What test would you add, exactly? As far as I know, this is a workaround for a bug that only exists in Chrome 74 and 75, last current in mid-2019. Or do you just mean integration tests for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Agree that tests would be nice addition.
I am not sure if this will actually fix the issue. My guess is the |
This, but we can skip for now if you want |
To be honest, I'm not sure, either. I can confirm that using the repro provided in the older issue, this error shows up in Chrome 74 and 75, but a) not in Chrome 76, and b) not if you use Before digging further, though, I'd like to try this, because it's a painless fix. If it doesn’t work, we can debug further. (If that does happen, because it turns out this is in fact a different problem, it'd be great if someone could figure out a way to reproduce the new problem.) This fix should land in 6.18.3, which will be released before the end of the week. |
Let's get this out so folks can try it, and handle the tests separately. Also, FWIW, we do actually have integration tests for both of those, they're just not playwright tests:
and
|
@lobsterkatie EDIT: Seems like the slowness does not exist on Chromium-based browsers. Firefox showed a significant dip in |
Interesting... I hadn't heard that before, so I just went and did a little research. Most of what I found was from the early aughts, but I did find one site which will benchmark it directly, and will also let you see other users' results, so you get to see a wider variety of platforms, browsers, and versions. The upshot is that you're right when it comes to Firefox (and the difference is pretty drastic), but in Safari and Chrome they're nearly identical. Firefox: Safari: Chrome: That said, I am an OG FF lover and mean no offense to its userbase, but it is also down to ~4% market share. So I'd like to go ahead and see if this fixes the problem, and if it doesn't, we can always revert and try a different strategy. |
Users have reported running into a bug in Chrome wherein calling
addEventListener
orrequestAnimationFrame
too many times onwindow
eventually throws an error when ourtry-catch
integration is running, specifically because of how we wrap those functions. In the discussion of that bug, one user reported that replacing ourcall
call with anapply
call in our wrapping functions solved the problem for him.This makes that change, in the hopes it will fix the problem for everyone.
Fixes #3388
Fixes #2074
Ref: https://getsentry.atlassian.net/browse/WEB-669